<?php

/**
 * Content
 *
 * @property integer $id
 * @property \Carbon\Carbon $created_at
 * @property \Carbon\Carbon $updated_at
 * @property-read \Topic $topic
 */
class Content extends Elegant {
	protected $fillable = [];
        
        public function topic(){
            return $this->belongsTo('Topic');
        }
        
        public function getBefore($title = null){
            
            $image = '<a class="fancybox-thumb" rel="fancybox-thumb" title="'.$title.'('.$this->year.')"  href="'.URL::to('image/'.$this->before_url).'"> '
                    . '<img  src="'.URL::to('image/'.$this->before_url).'" /> </a>';
            
            return $image;
        }
        
        public function getAfter($title = null ) {
            $image = '<a class="fancybox-thumb" rel="fancybox-thumb" title="'.$title.'('.$this->year.')" href="'.URL::to('image/'.$this->after_url).'"> '
                    . '<img src="'.URL::to('image/'.$this->after_url).'" /> </a>';
            return $image;
        }
}